home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1996 November / Software of the Month Club 1996 November.iso / mac / Software Research Institute-SRI / Education / CompuRoc 2.0.1 / CompuRoc 2.0.1 Manual / CompuRoc 2.0.1 Manual.rsrc / TEXT_132.txt < prev    next >
Text File  |  1994-06-14  |  7KB  |  79 lines

  1.  
  2.  
  3.                Exporting and Importing Text Files
  4.  
  5.  
  6. The utility of CompuRoc for many projects and applications depends on its ability to produce and accept external data.  As mentioned earlier it may often be useful to be able to transfer flight or thrust curve data to other applications (or even other computers) for such tasks as plotting, statistics, or other post-processing.  Similarly, it is often desirable to be able to load data (like a measured numerical thrust curve) into CompuRoc and work with it.  The format used by CompuRoc for data exchange with the "outside world" is plain text.  The files contain standard ASCII text characters, and may be read by most any word processing or text editing program.  Most Macintosh word processors include a "text-only" option for producing such plain text files, although a dedicated text editor (such as Edit, Alpha, BBEdit, QUED/M, etc.) is a better tool.  This chapter describes the CompuRoc options for saving and loading text history files.
  7.  
  8. ΓÇó Saving Simulation Histories
  9.  
  10. During and after a simulation run, the two components each (horizontal and vertical) of position and velocity are retained in the Macintosh's memory at time intervals of 0.1 seconds.  This run history (which can be viewed graphically in the display windows) can be saved at any time the simulation is stopped or paused, by selecting 'Save As Text' from the 'File' menu.  The standard Macintosh file specification dialog appears, prompting the user to provide a name for the history file.
  11.  
  12. The format of the saved text file is identical to that accepted by the 'Load Text File' option (see below).  Each line of the output file contains the time, horizontal position, vertical position, horizontal velocity, and vertical velocity.  The columns of numbers are separated by ASCII tab characters, which facilitates the transfer of data to spreadsheet and graphics programs (e.g. Microsoft Chart, Excel, Cricket Graph, etc.) which accept data in table form.
  13.  
  14. ΓÇó Saving Thrust Histories
  15.  
  16. Saving a thrust curve profile to a text history file works in the same way as for simulation histories.  Selecting 'Save History' from the 'File' menu while a curve is loaded in thrust editing mode calls up a file specification dialog and saves the thrust curve data to disk.  As above, the text file is a tab-delimited table of values.  In this case, there are only two columns, time and thrust.  The table entries give the thrust in Newtons at intervals of 0.01 seconds.  Also as with simulation histories, since the saved format is identical to that required by the 'Load History' options below, these files can be fed back into CompuRoc unchanged.
  17.  
  18. ΓÇó Loading Simulation Histories
  19.  
  20. Although the plotting capabilities of CompuRoc are limited in comparison with other general purpose plotting programs, users may want to load previously saved simulation histories into memory for viewing with CompuRoc's display options.  This is possible using the 'Load History' item under the 'File' menu while in simulation mode.  Upon making this selection and choosing a file via the file selection dialog box, the simulation history previously in memory (if any) is erased and the saved history is loaded.  Now the various components of velocity and position may be viewed using the 'Display' menu options.  This loaded flight history remains in memory until either a simulation run is started, or another history file is loaded into memory replacing it.
  21. Although the text files written by the 'Save History' option will be most often used for this purpose, it is also possible for users to write their own text files that are readable by CompuRoc.  The following format is recognized by CompuRoc as a simulation history file:
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46. The first non-blank characters in the file must be the word "STATE", and the last entry must be -1.00.  Between these, the time and state vector components are entered in the order shown, separated by any number of "white space" characters (spaces, tabs, carriage returns, etc.).  Remember that if you are using a word processing program to create this file, it must be saved as text only ( this means that the file's Finder Type Attribute must be 'TEXT').  Otherwise, CompuRoc will not recognize the file.
  47.  
  48.  
  49. ΓÇó Loading Thrust Histories
  50.  
  51. A similar text file format is used to load thrust curve histories into memory from an outside source.  This option for loading thrust curves will probably be even more useful than the above simulation history option, since it provides a direct means of entering numerical thrust data, bypassing the mouse entry method.  Of course, any thrust curve that has been loaded from a history file can be subsequently saved and graphically edited just as any other thrust curve document.  The following format is recognized by CompuRoc as a thrust history file:
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76. The first non-blank characters in the file must be the word "THRUST", and the last entry must again be -1.00.  Between these, the time and thrust values are entered, again separated by "white space" characters.   In addition, any line beginning with a semicolon (;) will be treated as a comment; it is ignored when read by the program and may be used to record supplementary information.  The above example shows a time interval between thrust values of 0.01 seconds, which is the internal time resolution of computations by CompuRoc and is the interval produced by the 'Save History' option.  If a larger time interval between thrust values occurs in the history file, CompuRoc linearly interpolates for the intervening values at 0.01 second intervals.  For example, a linear "ramp" or flat "boxcar" thrust profile could be generated with just two lines, the starting and ending time/thrust values.
  77. The same remarks regarding the creation of text history files outside CompuRoc apply as in the simulation history case.  Users who have access to digitized thrust/time data from various sources will find this option useful for quickly generating libraries of thrust curves.  Another use for the save/load history options is in the generation of "composite" thrust curves.  It may be desirable to make a thrust curve representing a "mixed cluster", that is, a cluster of two or more different kinds of engines.  One way of making such a composite thrust curve would be to save the constituent thrust profile histories, add the appropriate thrust values together, and then reload the combined curves into CompuRoc and save them as a new thrust file.  Users who have modest experience in programming in BASIC or some other language can easily write a short program to do the adding for them and make the job quite easy.
  78.  
  79.